<?php
/**
 *	This file is part of rtfdoc.
 *
 *	rtfdoc is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	rtfdoc is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with rtfdoc.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
/*
\fnil  	Unknown or default fonts (the default)
\froman 	Roman, proportionally spaced serif fonts 	Times New Roman, Palatino
\fswiss 	Swiss, proportionally spaced sans serif fonts 	Arial
\fmodern 	Fixed-pitch serif and sans serif fonts 	Courier New, Pica
\fscript 	Script fonts 	Cursive
\fdecor 	Decorative fonts 	Old English, ITC Zapf Chancery
\ftech 	Technical, symbol, and mathematical fonts 	Symbol
\fbidi 	Arabic, Hebrew, or other bidirectional font 	Miriam

*/
class RTFFont
{
    // FIXME: shouldn't this be TYPE_* constants?
    const FACE_AUTOMATIC = 'automatic';
    const FACE_NIL = 'nil';
    const FACE_ROMAN = 'roman';
    const FACE_SWISS = 'swiss';
    const FACE_MODERN = 'modern';
    const FACE_SCRIPT = 'script';
    const FACE_DECOR = 'decor';
    const FACE_TECH = 'tech';
    const FACE_BIDI = 'bidi';
    /**
     * holds the fontface
     *
     * @var string
     */
    private $face;
    /**
     * holds the fonttype
     *
     * @var string one of the RTFFont::FACE_* constants
     */
    private $type;
    /**
     * holds the fontcolor
     *
     * @var RTFColor
     */
    private $color;
    /**
     * holds the fontsize
     *
     * FIXME: whatsda unit?
     *
     * @var integer
     */
    private $size;
    /**
     * sets the fontface
     *
     * @param string $face
     * @param string $type one of the RTFFont::FACE_* constants
     * @return RTFFont
     */
    public function setFontFace($face, $type = RTFFont::FACE_AUTOMATIC)
    {
        $this->face = $face;
        if ($type == RTFFont::FACE_AUTOMATIC) {
            $type = $this->determineType($face);
        }
        $this->type = $type;
        return $this;
    }
    /**
     * tries to determine type based on the fontface
     *
     * @param string $face
     * @return string
     */
    public function determineType($face)
    {
        return 'roman';
    }
    /**
     * sets the fontcolor to use
     *
     * @param RTFColor $color
     * @return RTFFont
     */
    public function setColor($color)
    {
        $this->color = $color;
        return $this;
    }
    /**
     * sets the fontsize
     *
     * @param integer $size
     * @return RTFFont
     */
    public function setSize($size)
    {
        $this->size = $size;
        return $this;
    }
    /**
     * returns the fonttype
     *
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }
    /**
     * returns the fontface
     *
     * @return string
     */
    public function getFace()
    {
        return $this->face;
    }
}
?>